<h2>Game pot: <%= @game.pot %></h2>
<h2>Game blind: <%= @game.blind %></h2>
<h2>Game status: <%= @game.status %></h2>
  <div class="card_div">
    <% if !session[:flop].empty? %>
      <% session[:flop].each do |card|%> 
        <%= image_tag("/assets/#{card.to_s.last}/#{card.to_s.first}.png", class: 'card')%>
      <% end %>
    <% end %>
    <% if !session[:turn].empty? %>
      <% session[:turn].each do |card|%> 
        <%= image_tag("/assets/#{card.to_s.last}/#{card.to_s.first}.png", class: 'card')%>
      <% end %>
    <% end %>
    <% if !session[:river].empty? %>
      <% session[:river].each do |card|%> 
        <%= image_tag("/assets/#{card.to_s.last}/#{card.to_s.first}.png", class: 'card')%>
      <% end %>
    <% end %>
  </div>
<%# if @game.started? %>
<p><%#= link_to "Exit game", exit_game_path, :method => :put %></p>
<p class="player">
  Player hand
  </p>
  <% session[:player_cards].each do |card| %>
    <%= image_tag("/assets/#{card.to_s.last}/#{card.to_s.first}.png", class: 'card')%>
  <% end %>
    
</p>
<% if @game.started?  %>

  <% if raise?(session[:bot].turn) %>
    <%= form_tag call_game_path, :method => :put do%>
      <%= submit_tag "Call", :class => 'btn btn-warning' %>
    <% end %>

    <%= form_tag raise_bet_game_path, :method => :put do%>
      <%= select_tag :raise_bet, options_for_select((1..100)) %>
      <%= submit_tag "Raise", :class => 'btn btn-primary' %>
    <% end %>

    <%= form_tag fold_game_path, :method => :put do%>
      <%= submit_tag "Fold", :class => 'btn btn-danger' %>
    <% end %>
  
  <% else %>

    <%= form_tag check_game_path, :method => :put do%>
      <%= submit_tag "Check",:class => 'btn btn-success' %>
    <% end %>

    <%= form_tag raise_bet_game_path, :method => :put do%>
      <%= select_tag :raise_bet, options_for_select((1..100)) %>
      <%= submit_tag "Raise", :class => 'btn btn-primary' %>
    <% end %>

    <%= form_tag fold_game_path, :method => :put do%>
      <%= submit_tag "Fold", :class => 'btn btn-danger' %>
    <% end %>

  <% end %>

<% end %>
<% unless @game.started? %>
<p><%= link_to "Start game", start_game_path, :method => :put, :class => 'btn btn-primary'%></p>
<% end %>









